package com.ajieee.merge.util;

import com.ajieee.merge.exception.JsonProcessingRuntimeException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Getter;

/**
 * @author ajieee
 * @date 2025-10-03
 */
public class JacksonUtils {

	@Getter
	private static final ObjectMapper objectMapper = new ObjectMapper();

	public static JsonNode readTree(String json) {
		try {
			return objectMapper.readTree(json);
		} catch (JsonProcessingException e) {
			throw new JsonProcessingRuntimeException(e);
		}
	}

}
